'''
Created on 2017年10月3日

@author: lml
'''
import tensorflow as tf
if __name__ == '__main__':
    with tf.Session() as default_session:
        t = tf.Variable(tf.constant(value=[2, 1, 2, 2], dtype=tf.float32, name='w'))
        l = tf.nn.l2_loss(t, "l")
        init = tf.group(tf.global_variables_initializer(), tf.local_variables_initializer())
        default_session.run(init)
        print(default_session.run(l))
        
    